<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <button class="btn1">btn1</button>
     <button class="btn2">btn2</button>
     <button class="btn3">btn3</button>
     <script>
         var a = 1;
         console.log(a);
        let aa = '123';
        aa = 123;

        let obj = {
            name:'tom'
        }
        obj.sex = 'nan';


        let bb = 123;
        bb = 456;
        console.log(bb);
        let cc = {
            name:'jack'
        }
        cc.age = 18;
        console.log(cc);
        console.log('-------------------------');
        console.log(dd);
        var dd;
        var dd = '123';

        let ee;
        // let ee = '123'//let const 不能重复声明

        // 每一个按钮的下标
        const btnArr = document.querySelectorAll('button');
        console.log(btnArr);
        for(let i=0;i<btnArr.length;i++){
            btnArr[i].onclick = function(){
                console.log(i);
            }
        }

        const obj_1 = {
            name:'tom'
        }
        obj_1.sex = 'nan';

        let obj_2 = {
            name:'jack'
        }
        obj_2 = {
            name:'xiaoli'
        }
        console.log(obj_2);
        
     </script>
     <h1>1</h1>
</body>
</html>